CC = mingw32-gcc
CXX = mingw32-g++

CFLAGS = -g3 -Wall
CXXFLAGS = $(CFLAGS)
TARGET = "EpiCraft.exe"

OBJS =	obj/main.o \
		obj/Block.o \
		obj/BlockRender.o \
		obj/Chunk.o \
		obj/Client.o \
		obj/ClientConnect.o \
		obj/ClientThread.o \
		obj/Entity.o \
		obj/InventoryWindow.o \
		obj/Location.o \
		obj/MainMenu.o \
		obj/Material.o \
		obj/Painting.o \
		obj/Player.o \
		obj/Sign.o \
		obj/ThreadChunks.o \
		obj/ThreadCtrl.o \
		obj/ThreadGame.o \
		obj/ThreadListen.o \
		obj/ThreadRender.o \
		obj/ThreadVisibility.o \
		obj/Window.o \
		obj/World.o \
		obj/nbt.o \
		obj/perlin.o

LIBS = -lge -lcrypto -lopengl32 -lwsock32 -lgdi32

all: $(OBJS)
	$(CXX) $(CXXFLAGS) -o $(TARGET) $(OBJS) $(LIBS)

obj/%.o: %.c
	$(CC) $(CFLAGS) $(DEFS) -c $< -o $@

obj/%.o: %.cpp
	$(CXX) $(CXXFLAGS) $(DEFS) -c $< -o $@

clean:
	cd obj && $(RM) *.o
	$(RM) client.exe
